#import <UIKit/UIKit.h>


@class PersonDetailViewCell;
@protocol PersonDetailViewCellDelegate <NSObject>

- (void)goCommentAction:(PersonDetailViewCell *)obj;

@end

@interface PersonDetailViewCell : UITableViewCell

@property (nonatomic, strong) UIImageView *avatarImageView;    // 头像
@property (nonatomic, strong) UILabel *userNameLabel;          // 昵称
@property (nonatomic, strong) UIView *ratingView;              // 星级评分
@property (nonatomic, strong) UILabel *reviewLabel;            // 评价内容
@property (nonatomic, strong) UILabel *dateLabel;              // 日期
@property (nonatomic, strong) UIView  *photoContainerView;      // 图片容器
//@property (nonatomic, strong) UILabel *dateLabel;          // TA 评价
@property (nonatomic, strong) UILabel * goodComment;           // 好评
@property (nonatomic, strong) UIButton * allComment;           // 全部评价
@property (nonatomic, weak) id<PersonDetailViewCellDelegate> delegate;


/**
 * 设置评价数据
 * @param avatarImage 头像图片
 * @param userName 用户昵称
 * @param rating 评分(1-5)
 * @param reviewText 评价内容
 * @param dateString 评价日期
 * @param photoUrls 图片URL数组
 * @param placeholderImage 占位图片
 */
- (void)setupWithAvatar:(UIImage *)avatarImage
               userName:(NSString *)userName
                 rating:(NSInteger)rating
             reviewText:(NSString *)reviewText
             dateString:(NSString *)dateString
              photoUrls:(NSArray<NSString *> *)photoUrls
      placeholderImage:(UIImage *)placeholderImage;

/**
 * 设置评价数据（图片URL版本）
 * @param avatarUrl 头像图片URL
 * @param userName 用户昵称
 * @param rating 评分(1-5)
 * @param reviewText 评价内容
 * @param dateString 评价日期
 * @param photoUrls 图片URL数组
 * @param placeholderImage 占位图片
 */
- (void)setupWithAvatarUrl:(NSString *)avatarUrl
                  userName:(NSString *)userName
                    rating:(NSInteger)rating
                reviewText:(NSString *)reviewText
                dateString:(NSString *)dateString
               photoUrls:(NSArray<NSString *> *)photoUrls
        placeholderImage:(UIImage *)placeholderImage;

/**
 * 计算单元格高度
 * @param reviewText 评价内容
 * @param photoCount 图片数量
 * @param width 单元格宽度
 */
+ (CGFloat)calculateHeightForReviewText:(NSString *)reviewText
                              photoCount:(NSInteger)photoCount
                                 width:(CGFloat)width;

@end
